-
Notifications
You must be signed in to change notification settings - Fork 10.1k
PSS: Update the workspace new subcommand to work with PSS, add E2E and integration tests for using workspace commands with PSS.
#37855
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
727ae19 to
8f77b19
Compare
3226e68 to
345fef9
Compare
8f77b19 to
316d5b5
Compare
af8745d to
1e07af1
Compare
| protoReq := &proto6.DeleteState_Request{ | ||
| TypeName: r.TypeName, | ||
| StateId: r.StateId, | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found a bug during this work 🐛
workspace new subcommand to work with PSS, add E2E test.workspace new subcommand to work with PSS, add E2E and integration tests for using workspace commands with PSS.
55a606d to
734e6fd
Compare
734e6fd to
55de3b2
Compare
…e workspace command
…te files are created by given commands
We still need an E2E test for this, to ensure that the GRPC-related packages pass all the expected data between core and the provider.
55de3b2 to
b8f9088
Compare
| "github.com/hashicorp/terraform/internal/states/statemgr" | ||
| ) | ||
|
|
||
| func TestWorkspace_allCommands_pluggableStateStore(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote the E2E test for all the workspace commands and then worried that an integration test would be sufficient. After writing an integration test equivalent I realised that the bug I found was only discovered due to adding the E2E test, so the E2E test definitely has value being there.
At this point I'm unsure about whether to keep both tests or to only keep the E2E test.
(Stacked on top of #37790, due to needing
simple6implementations of PSS for E2E testing)This PR introduces a bunch of testing to show that the
workspacecommands work in combination with pluggable state storage. There is both an integration test and an E2E test showing that PSS can be used in the context of this sequence of actions:initto create a default workspaceIn this PR I also updated how
workspace newis implemented. This new code comment explains how the command previously achieved creating a new workspace:terraform/internal/command/workspace_new.go
Lines 99 to 106 in 55a606d
Pluggable state stores intentionally don't have side-effects in the same way, and instead Terraform is expected to create the state file explicitly. I've updated the
workspace newcommand to identify when PSS is in use and to only attempt to create the state file when that's the case. Due to this there isn't an issue of state files being 'created twice' etc when PSS isn't in use.Target Release
1.15.x
Rollback Plan
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.
CHANGELOG entry